package com.java.test.util;

/**
 * @author HTTP请求消息,错误码
 *
 */
public enum HttpErrorCode {
	
	REQUESTSUCCESS("请求成功",20000),

	PARAMERROR("结果数据为空", 10001),
	
	UPDATEDATAFAIL("操作失败请联系管理员",10011),
	
	SERVICEERROR("服务器未知错误", 10012),
	SYSTEMUSERERROR("系统管理员不可更新或删除", 10013),
	USERISEXITS("该账号已经存在", 10014),
	
	DATADEALNOTEXITS("该数据已处理", 10015),
	BANKCARDEXITS("该银行账户已存在", 10016),
	
	
	
	
	FILEISNULL("上传文件为空",10005),
	
	
	
	
	
	
	LOGINERROR("登录失败用户名或密码错误",10020),
	LOGINUSERSTATUSERROR("登录失败账号已被禁用",10021),
	OLDERROR("旧密码输入错误",10022),
	OLDPASSWORDNEWPASSWORDSAMEERROR("新密码与旧密码相同",10023),
	YZMCODEERROR("验证码不正确",10024),
	
	
	IPISERROR("IP段输入有误",10031),
	DOMAINISEXITS("域名重复请检查",10032),
	PLATNAMEISEXITS("平台名称重复请检查",10032),
	
	
	
	TERMINALISEXITS("终端已经存在请检查渠道ID",30001),
	TYPEISEXITSCHANNEL("该类型下存在渠道不可删除",30011),
	
	SKACCOUNTISEXITS("该收款渠道下存在收款账户不可删除",30012)
	
	
	
	
	

	;

	private String content;

	private int code;

	private HttpErrorCode(String content, int code) {
		this.content = content;
		this.code = code;
	}

	// 普通方法
	public static String getName(int code) {
		for (HttpErrorCode c : HttpErrorCode.values()) {
			if (c.getCode() == code) {
				return c.content;
			}
		}
		return null;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
	
}
